
<?php


function getagent($uid, $fs)
{
    $agent=new \app\common\model\Agent();
    $map['id'] = $uid;
    $agent =$agent->where($map)->find();

    switch ($fs) {
        case "name":
            return $agent['name'];
            break;
        case "zh":
            $Loginusers=new \app\common\model\LoginUsers();
            $zh = $Loginusers->where(array('id' => $agent['uid']))->value('username');
            return $zh;
            break;

    }
    //return $agent;
}



//上传证书命名
function uppem($arr){
    $res = $arr['wx_open_id'] . $arr['ext'];
    return $res;
}